﻿Imports System.Text

Public Class StringUtil
    Public Shared Function repetir(ByVal valor As String, ByVal n As Integer) As String
        Dim sb As New StringBuilder()
        If (n > 0) Then
            Dim i As Integer
            For i = 1 To n
                sb.Append(valor)
            Next
        End If
        Return sb.ToString()
    End Function

    'http://msdn.microsoft.com/en-us/library/ms172827.aspx
    Public Shared Function unicodeBytesToString(ByVal bytes() As Byte) As String
        Return System.Text.Encoding.Unicode.GetString(bytes)
    End Function
End Class
